<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Person () {
            this.foot = 2;
            this.head = 1;
            this.color = 'red';
        }
        // 原型链实现对原型属性和方法的继承
        Person.prototype.sayColor = function() {
            console.log('我喜欢的颜色是：'+this.color);
        }
        function Student (name, no) {
            // 借用构造函数实现对实例属性的继承
            Person.call(this);
            this.name = name;
            this.no = no;
        }
        Student.prototype = new Person();
        Student.prototype.constructor = Student;

        var px = new Student('pangX', 007);
        console.log(px);
        px.sayColor()

        var obj = {anme: 'xxx',a: 13,job: 'werwer'}
    </script>
</body>
</html>